<script setup lang="ts">
import { Button as VantButton } from 'vant'
import { useUserStore } from './stores/user'
import { request } from './utils/request'
import type { User } from './types/user'
const usestore = useUserStore()
// const fn = () => {
//   usestore.setUser({
//     id: '1',
//     mobile: '1',
//     account: '1',
//     avatar: '1',
//     token: '1',
//   })
// }
const fn = async () => {
  const res = await request<User>('/login/password', 'POST', {
    mobile: '13211112222',
    password: 'abc12345',
  })
  usestore.setUser(res.data)
}
</script>

<template>
  <vant-button type="danger" @click="fn">按钮</vant-button>
  <div class="box"></div>
</template>

<style scoped lang="scss">
.box {
  width: 100px;
  height: 100px;
  background-color: var(--cp-primary);
}
</style>
